from typing import List

class Solution:
    def maximumPopulation(self, logs: List[List[int]]) -> int:
        # 区间长度为
        # 1950 <= birthi < deathi <= 2050
        diff=[0]*101
        for start,end in logs:
            diff[start-1950]+=1
            diff[end-1950]-=1
        pre=[0]*101
        pre[0]=diff[0]
        for i in range(1,101):
            pre[i]=pre[i-1]+diff[i]
        # 找到最大值
        mx=max(pre)
        for i in range(101):
            if pre[i] == mx:
                return i+1950